package learn.basics.array;

import java.util.Arrays;

class Demo1PrintArray{
    public static void Test(){
        System.out.println("----------------------------class Demo1PrintArray--------------------------------");
        int[] array={10,20,30};

        System.out.print("[");

        for(int i=0;i< array.length;i++){
            if(i==array.length-1){
                System.out.println(array[i]+"]");
            }
            else {
                System.out.print(array[i]+ " ");
            }
        }

        System.out.println("=====================");
        System.out.println(Arrays.toString(array));
    }
}

class Demo2Student{
    public static void Test(){

        System.out.println("----------------------------class  Demo2Student--------------------------------");

        Student student=new Student();

        System.out.println(student.name_);
        System.out.println(student.age_);

        student.name_="小明";
        student.age_=22;

        System.out.println(student.name_);
        System.out.println(student.age_);

        student.Eat();
        student.Sleep();
        student.Study();
    }
}

class Demo01Arrays{
    public static void Test(){
        int [] int_arr={10,20,30};
        String int_str=Arrays.toString(int_arr);
        System.out.println(int_str);

        int[] arr1={2,1,3};
        Arrays.sort(arr1);
        System.out.println(Arrays.toString(arr1));
    }
}









public class TestArray {

    public static void main(String[] args) {

        //Demo1PrintArray.Test();
        //Demo2Student.Test();
        Demo01Arrays.Test();

    }

}
